package com.dlc.shop.user.common.enums;

/**
 * 成长值来源
 *
 * @Author lth
 * @Date 2021/10/19 9:37
 */
public enum GrowthLogSourceEnum {
    /**
     * 系统修改用户成长值
     */
    SYSTEM(0, "系统修改用户成长值", "System modify user growth value", "yami.growth.log.system"),
    /**
     * 订单确认收货获取成长值
     */
    ORDER_SUCCESS(1, "订单确认收货获取成长值", "Order confirmation and receipt to obtain growth value", "yami.growth.log.orderSuccess"),
    /**
     * 订单退款退回成长值
     */
    ORDER_FAIL(2, "订单退款退回成长值", "Order refund returns growth value", "yami.growth.log.orderFail"),
    /**
     * 余额
     */
    BALANCE(3, "用户充值余额获取的成长值", "The growth value obtained by the user's recharge balance", "yami.growth.log.balance")
    ;

    private final String cn;
    private final String en;
    private final String i18nTag;

    private final Integer num;

    public String getEn() {
        return en;
    }

    public String getCn() {
        return cn;
    }

    public Integer value() {
        return num;
    }

    public String getI18nTag() {
        return i18nTag;
    }

    GrowthLogSourceEnum(Integer num, String cn, String en, String i18nTag){
        this.num = num;
        this.cn = cn;
        this.en = en;
        this.i18nTag = i18nTag;
    }

    public static GrowthLogSourceEnum instance(Integer value) {
        GrowthLogSourceEnum[] enums = values();
        for (GrowthLogSourceEnum sourceEnum : enums) {
            if (sourceEnum.value().equals(value)) {
                return sourceEnum;
            }
        }
        return null;
    }
}
